package or;

public class T0485 {
    public int findMaxConsecutiveOnes(int[] nums) {
        int max=0;
        int i=0;
        while (i<nums.length){
            int sum=0;
            while (i<nums.length&&nums[i]==1){
                sum++;
                i++;
            }
            max=Math.max(max,sum);
            i++;
        }
        return max;
    }
}
